package cn.jiyun.address.controller;

import cn.jiyun.address.pojo.Address;
import cn.jiyun.address.service.AddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/address")
@CrossOrigin(allowedHeaders = "*")
public class AddressController {
    @Autowired
    private AddressService addressService;
    @GetMapping("/{pid}")
    public List<Address> findAddrList(@PathVariable("pid")Integer pid){
        log.info("pid:{}",pid);
        return addressService.findAddrList(pid);
    }
}
